package com.unknowpupil.web.base.email.entity;

import com.unknowpupil.web.utils.RegexpUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Pattern;

/**
 * @Classname: Mail
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2019/10/8 16:10
 * @Description:  必要时候可以插入数据库
 * @Version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Mail {

    /**
     * 发送方
     */

    private String from;

    /**
     * 接收方
     */
    @Pattern(regexp = RegexpUtils.EMAIL, message = "邮件格式不对")
    private String to;

    /**
     * 标题
     */

    private String title="hello email";

    /**
     * 发送内容
     */
    @Length(min = 6, max = 20, message = "内容鉴于 6 和 20 之间")
    private String content = "welcome to w10g";

    /**
     * 文件路径
     */

    private String filePath;

    /**
     * 邮件状态
     */
    private Integer status;


}
